<!DOCTYPE html>
<html lang="en">
	<head>
	<?php
	if(!isset($_SESSION)){
	session_start();
	}
	?>
	</head>
	<body>
<!-- Body Template -->
		<?php
		if (isset($success) )
		{
		echo $success;?>
		<br />
		<?php
		}
		?>
		<?php
		if (!isset($_SESSION['username']) )
		{
		?>
		
	<a href=<?php echo base_url("user/register")?>>Register</a>
	<a href=<?php echo base_url("user/login")?>>Login</a>
		<?php
		}
		?>
		
		<?php
		if (isset($_SESSION['username']) )
		{
		?>
		<?php echo $_SESSION['username'] ?> , <a href=<?php echo base_url("user/logout")?>>logout</a>
		<?php
		//echo $user -> user_admin;
		$admin = $user->user_admin;
		if ($admin == 1 )
		{ 
		?>
		<a href=<?php echo base_url("admin")?>> admin</a>
		<?php
		}
		?>
		<?php
		}
		?>
	</br>
			<?php foreach($summary as $sum): ?>
				<a href="<?php echo base_url("summary/byId/$sum->summary_id"); ?>">
			<tr>
					<td>
					<b><?php echo $sum->summary_title?></b>
					<br />
					</td>	
					<td>
					<?php echo $sum->summary_content ?>
					<br />
					</td>
				
			</tr>
		<?php endforeach;?>

		
<!-- -->
	</body>
</html>